package cn.springboot.erp.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 
 * @TableName sales_order_details
 */
@TableName(value ="sales_order_details")
@Data
public class SalesOrderDetails implements Serializable {
    /**
     * 订单ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 订单ID，关联销售订单表
     */
    @TableField(value = "order_id")
    private Integer orderId;

    /**
     * 商品ID，关联商品表
     */
    @TableField(value = "product_id")
    private Integer productId;

    /**
     * 销售数量
     */
    @TableField(value = "quantity")
    private Integer quantity;

    /**
     * 售价
     */
    @TableField(value = "price_per_unit")
    private Double pricePerUnit;

    /**
     * 小计
     */
    @TableField(value = "sub_total")
    private Double subTotal;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}